#ifndef OPTIONTAB_H
#define OPTIONTAB_H

#include <QtWidgets/QtWidgets>
#include "shard.h"

class OptionTab : public QWidget
{
  Q_OBJECT
public:
  explicit OptionTab(QWidget *parent = 0);
  ~OptionTab();

signals:
  
public slots:
  void eventRegionChanged(int reg);
  void eventListenClicked();
  void eventStopClicked();
  void eventListening(Shard s);
  void eventStopping();

signals:
  void eventListenToIt(Shard s);
  void eventStopListening();

private:
  QVBoxLayout* mainLayout;

  class IdBox : public QGroupBox
  {
  public:
    explicit IdBox(QWidget *parent = 0);

    QVBoxLayout idBoxLayout;

    QHBoxLayout firstLine;
    QLabel regionLabel;
    QComboBox regionComboBox;

    QHBoxLayout secondLine;
    QLabel emailLabel;
    QLineEdit emailTextBox;

    QHBoxLayout thirdLine;
    QLabel passwordLabel;
    QLineEdit passwordTextBox;

    QHBoxLayout fourthLine;
    QLabel authcodeLabel;
    QLineEdit authcodeTextBox;

    QPushButton connectButton;
  };

  IdBox* firstBox;

  class EventBox : public QGroupBox
  {
  public:
    explicit EventBox(QWidget *parent = 0);

    QVBoxLayout eventBoxLayout;

    QHBoxLayout firstLine;
    QLabel regionLabel;
    QComboBox regionComboBox;

    QHBoxLayout secondLine;
    QLabel shardLabel;
    QComboBox shardComboBox;

    QHBoxLayout thirdLine;
    QCheckBox notifyCheckBox;
    QPushButton listenButton;
    QPushButton stopButton;
  };

  EventBox* secondBox;
};

#endif // OPTIONTAB_H
